import { request } from "@/utils/service"


/** 上传文件 **/
export default function uploadFile(file: any, params: any) {

    const formData = new FormData()
    formData.append('file', file)

    if (params) {
        for (const key in params) {
            formData.append(key, params[key])
        }
    }

    return request.post('/fileUpload', formData, {
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    })
}
